<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="_meta :: header">
    <title>编辑</title>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <form class="layui-form form form-horizontal" id="form-weixinUser-edit" action="#"
              th:action="@{/admin/weixinUser/edit}" th:object="${weixinUser}" enctype="multipart/form-data">
            <input type="hidden" name="id" th:value="${weixinUser.id}"/>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>昵称：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.nickName}" name="nickName"  placeholder="修改昵称" id="nickName"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>性别 1：男：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.gender}" name="gender"  placeholder="修改性别 1：男" id="gender"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>语言：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.language}" name="language"  placeholder="修改语言" id="language"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>城市：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.city}" name="city"  placeholder="修改城市" id="city"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>省份：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.province}" name="province"  placeholder="修改省份" id="province"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>头像地址：</label>
                    <div class="layui-input-inline">
                        <input class="layui-input upload-url" type="text"  readonly="" style="width:400px">
                        <a href="javascript:void();" class="btn btn-primary upload-btn"><i class="Hui-iconfont"></i> 浏览文件</a>
                    <input type="file" multiple="" style="width:100%; height:100%" th:value="${weixinUser.avatarUrl}" name="avatarUrlFile"   id="avatarUrl" class="input-file valid">
                        <br/>
                        <img th:src="@{{path}(path=${weixinUser.avatarUrl})}" style=" width:100xp; height:100px;"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>唯一主键id：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.openId}" name="openId"  placeholder="修改唯一主键id" id="openId"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>创建时间：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.createtime}" name="createtime"  placeholder="修改创建时间" id="createtime"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>更新时间：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.updatetime}" name="updatetime"  placeholder="修改更新时间" id="updatetime"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>用户姓名：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.userName}" name="userName"  placeholder="修改用户姓名" id="userName"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>用户联系方式：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.phone}" name="phone"  placeholder="修改用户联系方式" id="phone"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>所在单位：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${weixinUser.currentUnit}" name="currentUnit"  placeholder="修改所在单位" id="currentUnit"/>

                        </div>
                        </div>
                        </div>

                        <div class="layui-form-item">
                        <label class="layui-form-label">
                        </label>
                        <button  class="layui-btn" id="subbtn" type="submit" >
                        增加
                        </button>
                        <button  class="layui-btn" id="reset" type="reset" >
                        重置
                        </button>
                        </div>
                        </form>
                        </div>
                        </div>
<!--_footer 作为公共模版分离出去-->
<div th:replace="_footer :: footerjs"></div>
<div th:replace="_ueditor :: ueditor"></div>
<!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script>
    layui.use(['form', 'layer','laydate'],function() {
        $ = layui.jquery;
        var form = layui.form,
            laydate = layui.laydate,
            layer = layui.layer;
        lay('.timeSpace').each(function(){
            laydate.render({
                elem: this
                ,trigger: 'click'
                ,type: 'datetime'
            });
        });
    });
    $(function () {
        $("#form-weixinUser-edit").validate({
            rules: {
        nickName:
        {
            required: true,
        },
        gender:
        {
            required: true,
        },
        language:
        {
            required: true,
        },
        city:
        {
            required: true,
        },
        province:
        {
            required: true,
        },
        avatarUrl:
        {
            required: true,
        },
        openId:
        {
            required: true,
        },
        createtime:
        {
            required: true,
        },
        updatetime:
        {
            required: true,
        },
        userName:
        {
            required: true,
        },
        phone:
        {
            required: true,
        },
        currentUnit:
        {
            required: true,
        },
    },
        onkeyup:false,
            debug
    :
        true,
            success
    :
        "valid",
            submitHandler
    :

        function (form) {
            $(form).ajaxSubmit({
                type: 'POST',
                url: "/admin/weixinUser/edit",
                success: function (data) {
                    if (data.code == "1") {
                        selfmsg('编辑成功!', 1, function () {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.location.reload();
                            parent.layer.close(index);
                        });
                    } else {
                        selfmsg('编辑失败!');
                    }
                },
                error: function () {
                    selfmsg('编辑异常!', 5);
                }
            });
        }
    })
        ;
    });

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>